#ifndef _PROJECT1_RECTDOMAIN_H_
#define _PROJECT1_RECTDOMAIN_H_ 

#include "Core/Box.h"

template <int Dim>
class RectDomain : public Box<Dim>
{
public:
using rVec=Vec<Real,Dim>;
using iVec = Vec<int,Dim>;
using BaseClass = Box<Dim>;

RectDomain() = default;

RectDomain(const BaseClass &aBox, const rVec& aDx)
      : BaseClass(aBox), dx(aDx)
  {
  }

// accessor
public:
  using BaseClass::lo;
  using BaseClass::hi;
  using BaseClass::size;
  //
  const rVec &spacing() const { return dx; }

  bool contain(const rVec &pos) const 
  {    return (min_of(hi()*dx-pos) > 0) && (min_of(pos-lo()*dx) > 0);}

protected:
  rVec dx;
};


#endif // !_PROJECT1_RECTDOMAIN_H_
